home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / pluginy Firefox / 1191 / 1191.xpi / chrome / reminderfox.jar / content / reminderfox / editing / todoOptionsDialog.js < prev    next >
Encoding:
Text File  |  2009-11-24  |  1.8 KB  |  70 lines

  1. function reminderFox_saveOptions() {
  2.     var newTodo = window.arguments[0].todo;        
  3.     var success = reminderFox_saveTodoOptions( newTodo );
  4.     if ( success ) {            
  5.         window.arguments[0].addTodo = true;
  6.     
  7.         window.close();
  8.     }
  9. }
  10.  
  11.  
  12. function reminderFox_saveTodoOptions(newTodo) {
  13.     var success = saveEvent( newTodo );
  14.     if ( !success ) {
  15.         return false;
  16.     }
  17.             
  18.     var showInTooltip = document.getElementById("showInTooltip");
  19.     var showInTooltipVal =  showInTooltip.getAttribute("checked" );
  20.     if ( showInTooltipVal == true || showInTooltipVal == "true" ) { 
  21.         newTodo.showInTooltip = true;
  22.     }
  23.     else {
  24.         newTodo.showInTooltip = false;
  25.     }            
  26.     return true;    
  27. }
  28.  
  29.  
  30. function loadTodoOptions() {
  31.     var newTodo = window.arguments[0].todo;
  32.     var editing = window.arguments[0].editing;
  33.     var copying = window.arguments[0].copying;
  34.     if ( editing && !copying ) {
  35.         document.title =     reminderFoxBundle.getString("rf.options.todo.edit.title");
  36.     }
  37.     else {
  38.         document.title =     reminderFoxBundle.getString("rf.options.todo.add.title");
  39.     }        
  40.     
  41.     loadTodos( newTodo, editing );
  42. }
  43.  
  44.  
  45. function loadTodos( newTodo, editing ) {
  46.     loadEvent( newTodo, editing );
  47.                     
  48.     var showInTooltip = document.getElementById("showInTooltip");    
  49.     var showInTooltipDefault = true;
  50.     if ( !editing ) {
  51.         try {
  52.             showInTooltipDefault =  reminderFox_getPreferenceValue( REMINDER_FOX_DEFAULT_SHOW_IN_TOOLTIP );    
  53.             if ( showInTooltipDefault || newTodo.showInTooltip == true  ) {
  54.                     showInTooltip.setAttribute( "checked", true );
  55.             }
  56.             else {
  57.                     showInTooltip.setAttribute( "checked", false );
  58.             }
  59.         } catch(e) {
  60.         }    
  61.     }
  62.     else {                    
  63.         if ( newTodo.showInTooltip == true ) {
  64.                 showInTooltip.setAttribute( "checked", true );
  65.         }
  66.         else {
  67.                 showInTooltip.setAttribute( "checked", false );
  68.         }
  69.     }    
  70. }